home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 9
/
FM Towns Free Software Collection 9.iso
/
t_os
/
tool
/
wings
/
w2_src
/
test_1.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-11-16
|
1KB
|
69 lines
// 12ドットフォント一覧表示プログラム
// SP:次のページ BS:前のページ CR:終了
#include <egb.h>
#include <fnt.h>
#include <stdio.h>
#include <string.h>
#include <fmcfrb.h>
#include "define.h"
void paging( int );
char egbwork[EgbWorkSize], buff[ 110592 ];
void main( void )
{
int p;
UINT moji, key;
FILE *fp;
fp = fopen( "d:\\sysinit\\system.fnt", "rb" );
fread( buff, 1, 110592, fp );
fclose( fp );
EGB_init( egbwork, 1536 );
KYB_init( );
KYB_clic( 1 );
p = 0;
do {
paging( p );
do {
moji = KYB_read( 1, &key ) % 256;
if( moji==8 && p ){
p--;
break;
}
if( moji==0x20 && p!=15 ){
p++;
break;
}
if( moji==0x0d )
return;
} while( 1 );
} while( 1 );
}
void paging( int p )
{
int i, j;
struct {
char *pt;
short sel, x1, y1, x2, y2;
} font = { 0, 0x14, 0, 0, 15, 15 };
EGB_clearScreen( egbwork );
for( j=0;j<=5;j++ ){
for( i=0;i<=47;i++ ){
font.pt = buff+256*12+i*24+j*48*24+p*48*6*24;
font.x1 = i*12;
font.y1 = j*12;
font.x2 = i*12+11;
font.y2 = j*12+11;
EGB_putBlockColor( egbwork, 0, ( char *)&font );
}
}
}